package com.itheima.homework.homework3;

import java.util.Arrays;
import java.util.Scanner;

public class HomeWork33 {
    public static void main(String[] args) {
        String[ ] stus = {"111", "222","333","444","555","666"};
        int[] arr=new int[stus.length];
        for (int i = 0; i < stus.length; i++) {
            arr[i]=Integer.parseInt(stus[i]);
        }
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入您要查找的人名:");
        String  name1= sc.next();
        int name=Integer.valueOf(name1);
        int index=Arrays.binarySearch(arr,name);
        System.out.println(index);
        if(index>=0){
            System.out.println(name1+"是系统中存储的第"+(index+1)+"个用户！");
        }else{
            System.out.println(name1+"不是系统中的用户！");
        }

    }
}
